package com.lwx.json;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class JsonMain {

    /**
     * @author liangwenxin
     * @param args
     */
    public static void main(String[] args) {
        List<AA> list = new ArrayList<AA>();
        list.add(new AA("a", 1));
        list.add(new AA("b", 2));
        System.out.println(JsonUtil.toJson(new AA("a", 1)));
    }
    
    static class AA{
        private String s;
        private int i;
        private List<AA> list;
        private Map<String, String> map;
        
        public AA(String s, int i){
            this.s = s;
            this.i = i;
            list = new ArrayList<AA>();
            map = new HashMap<String, String>();
            map.put("ddd", "sd");
            map.put("aa", "sd");
        }
        public String getS() {
            return s;
        }
        public void setS(String s) {
            this.s = s;
        }
        public int getI() {
            return i;
        }
        public void setI(int i) {
            this.i = i;
        }
        public List<AA> getList() {
            return list;
        }
        public void setList(List<AA> list) {
            this.list = list;
        }
        public Map<String, String> getMap() {
            return map;
        }
        public void setMap(Map<String, String> map) {
            this.map = map;
        }
    } 
}
